package com.lanou.connotationjoke.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by dllo on 16/1/8.
 */
public class HomePagerAdapter extends FragmentPagerAdapter{
    private List<Fragment> fragments;
    private String[] titles = {"推荐","视频","图片","段子","订阅","精华","同城","收藏"};
    public HomePagerAdapter(FragmentManager fm,List<Fragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
